﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Lottery.Control {
    public partial class HZControl : UserControl {
        public HZControl() {
            InitializeComponent();

            edit3.ReadOnly = true;
            edit3.JumpToNext = edit1;
            edit1.ReadOnly = true;
            edit1.JumpToNext = edit0;
            edit0.ReadOnly = true;
        }

        private int m_index;
        /// <summary>
        /// 场次
        /// </summary>
        public int Index { 
            get { return m_index; }
            set {
                m_index = value;
                labelOrder.Text = string.Format("第 {0} 场", m_index); ;
            }
        }

        private System.Windows.Forms.Control jumpToNext;
        /// <summary>
        /// 按回车键的时候，焦点跳转到的控件
        /// </summary>
        public System.Windows.Forms.Control JumpToNext {
            get { return jumpToNext; }
            set {
                jumpToNext = value;

                edit0.JumpToNext = value;
            }
        }

        public decimal Three { get { return edit3.Value; } }

        public decimal One { get { return edit1.Value; } }

        public decimal Zero { get { return edit0.Value; } }

        public void Set310(string three, string one, string zero) {
            edit3.Text = three;
            edit1.Text = one;
            edit0.Text = zero;
        }

        public void ClearData() {
            Set310(string.Empty, string.Empty, string.Empty);
        }
    }
}
